// 导入 angular 的核心库
import { NgModule } from '@angular/core';

// 导入 路由 和 路由模板
import { Routes, RouterModule } from '@angular/router';

// 导入 ngx-echarts
import { NgxEchartsModule } from 'ngx-echarts';

// 导入 ShareModule
import { SharedModule } from 'src/app/shared/shared.module';

// 导入组件
import { ThreatComponent } from './pages/threat.component';
import { ThreadLocationComponent } from './pages/threat-location/threat-location.component';
import { ThreadListComponent } from './pages/threat-list/threat-list.component';
import { ThreatWorkflowComponent } from './pages/threat-workflow/threat-workflow.component';
import { ThreatListDetailComponent } from './pages/threat-list-detail/threat-list-detail.component';

// 路由配置
const routes: Routes = [
  {
    // 一级路由
    path: '', component: ThreatComponent,
    // 二级路由
    children: [
      { path: '', component: ThreadLocationComponent },
      { path: 'threat-location', component: ThreadLocationComponent },
      { path: 'threat-list', component: ThreadListComponent },
      { path: 'threat-workflow', component: ThreatWorkflowComponent },
      { path: 'threat-list-detail', component: ThreatListDetailComponent }
    ]
  },
];

@NgModule({
  // 导入路由配置和共享模版
  imports: [RouterModule.forChild(routes), SharedModule, NgxEchartsModule],
  declarations: [ThreatComponent, ThreadLocationComponent, ThreadListComponent, ThreatWorkflowComponent, ThreatListDetailComponent]
})
export class ThreatModule { }
